package com.haidechizi.i18n.code.generator.common;

import java.util.Optional;

/**
 * @author wangdejun
 */
public class GlobalConfig {

    private static ThreadLocal<String> translateTypeThreadLocal = new ThreadLocal<>();

    public static void setTranslateType(String translateType) {
        translateTypeThreadLocal.set(translateType);
    }

    public static String getTranslateType() {
        return Optional.ofNullable(translateTypeThreadLocal.get()).orElse("");
    }

    public static void remove() {
        translateTypeThreadLocal.remove();
    }
}
